package com.wideplay.warp.security;

import net.jcip.annotations.ThreadSafe;

import javax.servlet.*;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * On: 25/09/2007
 *
 * Register this filter in web.xml so that Warp can hook into the
 * injector chain. This is a stateless filter.
 *
 * @author Dhanji R. Prasanna
 * @since 1.0
 */
@ThreadSafe
public class SecurityFilter implements Filter {

    public void destroy() {
        FilterChainDispatch.getSecurityFilterChain().destroy();
    }

    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        FilterChainDispatch.getSecurityFilterChain().doFilter(servletRequest, servletResponse, filterChain);
    }

    public void init(FilterConfig filterConfig) throws ServletException {
        FilterChainDispatch.getSecurityFilterChain().init(filterConfig);
    }
}
